using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DTO;
using BUS;

namespace Presentation
{
    public partial class frmTimKiemLoaiPhong : Form
    {
        public frmTimKiemLoaiPhong()
        {
            InitializeComponent();
        }

        private void btnHuyBo_Click(object sender, EventArgs e)
        {
            Close();
        }

        private void btnTimKiem_Click(object sender, EventArgs e)
        {
            LoaiPhongBUS lpBUS = new LoaiPhongBUS();
            LoaiPhongDTO lpDTO = new LoaiPhongDTO();
            LoaiPhongDTO[] Arr = new LoaiPhongDTO[100];
            lpDTO.MaLP = txtMaLoaiPhong.Text;
            lpDTO.TenLP = txtTenLoaiPhong.Text;
            if (string.Compare(txtDonGia.Text, "") != 0)
                lpDTO.DonGia = Convert.ToInt64(txtDonGia.Text);
            lpDTO.MoTa = txtMoTa.Text;
            Arr = lpBUS.TimKiemLoaiPhong(lpDTO.ID_LP,lpDTO.MaLP,lpDTO.TenLP,lpDTO.DonGia,lpDTO.MoTa);
            dtgvDanhSachLoaiPhong.DataSource = Arr;
        }
    }
}